Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of bug fixes relating to failed builds and recovery from them #550

Merged
merged 7 commits into from
Oct 30, 2017

Conversation

jakemac53
Copy link
Contributor

  • Adds a new type of asset node, a SyntheticAssetNode. These are created if a build step calls canRead for an asset that doesn't exist. Those files still need to be tracked so if they are added later on that build step gets invalidated.
  • Changes scopeLog to scopeLogAsync, since its always used in an async context, and we now run in an error handling zone that logs errors to logger.severe. Any call to scopeLogAsync is now guaranteed to eventually complete with exactly one error or value, and will not leak unhandled async errors.
  • Updates the call to runBuilder to pass in a logger whose name is $builder on $input, so you get more context for errors.
  • Fixes the computeTransitiveModules to check that modules exist before trying to read them, and warn if they don't. Eventually we probably want this to fail the build as well, but only on some equivalent of "--mode=release". For dev time we probably don't want any builds to fail so the app can serve errors in a friendly fashion.
  • Fixes a bug in updateAndInvalidate where it would delete nodes that shouldn't be deleted.

Fixes #548.

@googlebot googlebot added the cla: yes Google is happy with the PR contributors label Oct 27, 2017
@jakemac53 jakemac53 requested a review from natebosch October 27, 2017 19:49
await buildStep.writeAsString(
buildStep.inputId.changeExtension(jsModuleErrorsExtension), '$e');
log.severe('', e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string? Weird?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just logging the error - it feels a bit weird for sure but there is already additional context provided by the loggers name (it is named based on the current builder and primary input).

The logger handles consistently formatting the error already as well - so that ends up being nicer than passing the error as the message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...why no stack? Not useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya - we don't have a true stack trace here. This error is originating from a worker, and contains the entire message that the worker sent back - which may or may not contain a useful stack trace already.

Copy link
Member

@natebosch natebosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be sensible to add any unit tests specifically around replacing a SyntheticAssetNode with a real one? We probably want to make sure it works for it to get replaced with either a source or generated file.

The changes LGTM.

@jakemac53
Copy link
Contributor Author

Would it be sensible to add any unit tests specifically around replacing a SyntheticAssetNode with a real one? We probably want to make sure it works for it to get replaced with either a source or generated file.

Ya, this is effectively being tested with the ddc error recovery e2e test, but some unit tests would be good as well, I can work on that.

@jakemac53
Copy link
Contributor Author

Travis is having issues today, going to run with a local mono_repo presubmit and submit assuming that passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google is happy with the PR contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants